package golf;

import golf.Character.CharacterGrade;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import database.DAO;


public class ProductService {
	int no;
	String name;
	int price;
	int period;
	String grade_name;
	float grade_exp;
	float grade_prize;
	float grade_course_green_fee;
	

	public ProductService(){}
	/*
	 * PSNO	NUMBER
	PSNM	VARCHAR2(40)
	PSPRICE	NUMBER
	PSPRD	NUMBER
	PSGRADENM	VARCHAR2(20)
	PSGRADEEXP	FLOAT
	PSGRADEPRZ	FLOAT
	PSGRADECRSGRF	FLOAT
	 */
	public ProductService(ResultSet rs ){
		try {
			setNo( rs.getInt("PSNO") );
			setName(rs.getString("PSNM"));
			setPrice( rs.getInt("PSPRICE") );
			setPeriod( rs.getInt("PSPRD") );
			setGrade_name(rs.getString("PSGRADENM"));
			setGrade_exp(rs.getFloat("PSGRADEEXP"));
			setGrade_prize(rs.getFloat("PSGRADEPRZ"));
			setGrade_course_green_fee(rs.getFloat("PSGRADECRSGRF"));
			
		} catch (SQLException e) {
			System.out.println("ProductService 생성자에서 레코드 읽던 중 에러가 발생!!");
			e.printStackTrace();
		}
	}
	
	public int getNo() {
		return no;
	}
	public void setNo(int no) {
		this.no = no;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getPrice() {
		return price;
	}
	public void setPrice(int price) {
		this.price = price;
	}
	public int getPeriod() {
		return period;
	}
	public void setPeriod(int period) {
		this.period = period;
	}
	public String getGrade_name() {
		return grade_name;
	}
	public void setGrade_name(String grade_name) {
		this.grade_name = grade_name;
	}
	public float getGrade_exp() {
		return grade_exp;
	}
	public void setGrade_exp(float grade_exp) {
		this.grade_exp = grade_exp;
	}
	public float getGrade_prize() {
		return grade_prize;
	}
	public void setGrade_prize(float grade_prize) {
		this.grade_prize = grade_prize;
	}
	public float getGrade_course_green_fee() {
		return grade_course_green_fee;
	}
	public void setGrade_course_green_fee(float grade_course_green_fee) {
		this.grade_course_green_fee = grade_course_green_fee;
	}
	
	
	
}
